<template>
  <div class="header">
    
    <span class="back">
       <slot></slot>
    </span>
    <!-- 父组件传递了title就不使用meta了 -->
    <span>{{  title ? title : $route.meta.title }}</span>
  </div>
</template>

<script>
export default {
  props:['title']
}
</script>

<style scoped>
.header{
    height: 0.4rem;
    line-height: 0.4rem;
    text-align: center;
    color: white;
    background-color: tomato;
    position: relative;
}
.back{
  position: absolute;
  left: 5px;
  top: 0px;
  height: 100%;
  display: inline-block;
}
</style>